<!--  -->
<template>
  <div class="buy-music">
    <div class="div1">
      <div class="header-logo">
      <img
        src="https://y.gtimg.cn/mediastyle/yqq/img/logo@2x.png?nowebp=1"
        alt=""
      />
    </div>
    <div class="header-nav">
      <li >
        <a href="javascript:;" >音乐馆</a>
      </li>
      <li style="background: #31c27c"><a href="javascript:;" style="color: #fff">我的音乐</a></li>
    </div>
    <div class="header-input">
      <input type="text" placeholder="搜索音乐、MV、歌单、用户" />
      <button>
        <i></i>
      </button>
    </div>
    <div class="header-login">
      <a :class="[{ show: show }]" @click="handleLogin()">登录</a>
      <a class="showuser" :class="[{ show: !show }]"
        >{{ item }},你好!
        <p class="loginout" @click="handleLoginOut()">退出登录</p>
      </a>
    </div>
    </div>
    <div class="portal-music-header">
      <div class="portal-music-header-inner">
        <div class="portal-music-header-link">
          <span class="portal-music-header-image"></span>
        </div>
        <h1>
          <span class="portal-music-header-name">XXX</span>
          <a href="#"
            ><img
              src="https://y.gtimg.cn/music/icon/v1/mac/svip_g@2x.png?max_age=2592000"
              alt=""
              class="lv"
          /></a>
        </h1>
      </div>
    </div>
    <div class="portal-music-main">
      <div class="portal-music-main-nav">
        <a href="#" class="portal-music-main-navlike" @click="handleClick()">我喜欢</a>
        <a href="#" class="portal-music-main-navlike active">我的已购</a>
        <a href="#" class="portal-music-main-navlike" @click="handleClick1()">我创建的歌单</a>
        <a href="#" class="portal-music-main-navlike">我上传的视频</a>
      </div>
      <div class="portal-music-main-list">
        <div class="portal-music-main-list-tab">
          <a href="#" class="portal-music-main-list-tab-item active"
            >数字专辑</a
          >
          <a href="#" class="portal-music-main-list-tab-item">单曲</a>
          <a href="#" class="portal-music-main-list-tab-item">实体周边</a>
        </div>
        <div class="portal-music-main-list-cont">
          <div class="portal-music-main-list-cont-sub">
            <div class="portal-music-main-list-cont-sub-list">
              <ul class="portal-music-main-list-cont-sub-list-playlist">
                <li class="portal-music-main-list-cont-sub-list-playlist-item">
                  <div
                    class="portal-music-main-list-cont-sub-list-playlist-item-box"
                  >
                    <div
                      class="portal-music-main-list-cont-sub-list-playlist-item-box-cover"
                    >
                        <a href="#"><img src="https://y.gtimg.cn/music/photo_new/T002R300x300M000000etWPH2Sk6kG.jpg?max_age=2592000" alt="" class="pic">
                            <i class="icon"></i>
                        </a>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      show: this.$store.state.status,
      item: localStorage.getItem("username"),
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    handleClick:function(){
      this.$router.push("portal");
    },
    handleClick1:function(){
      this.$router.push("mycreate");
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang="less" scoped>
.buy-music {
  .div1 {
    cursor: pointer;
  width: 1200px;
  height: 90px;
  display: flex;
  margin: 0 auto;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  .header-logo {
    margin-top: 22px;
    img {
      width: 170px;
      height: 46px;
    }
  }

  .header-nav {
    display: flex;
    margin-left: -50px;
    li {
      margin: 0 20px;
      list-style: none;
      width: 120px;
      height: 90px;
      line-height: 90px;
      text-align: center;
      font-size: 30px;
    }
    li:hover {
      a {
        color: #31c27c;
      }
    }
    a {
      list-style: none;
      color: #000;
      text-decoration: none;
    }
  }

  .header-input {
    height: 90px;
    vertical-align: auto;
    position: relative;
    line-height: 90px;
    input {
      padding: 0 10px;
      outline: none;
      width: 200px;
      height: 30px;
    }
    button {
      position: absolute;
      top: 30px;
      right: 0;
      border: 0 none;
      width: 38px;
      height: 35px;
      overflow: visible;
      background: 0 0;
    }
    i {
      background-image: url(https://y.gtimg.cn/mediastyle/yqq/img/icon_sprite.png?max_age=2592000&v=85678e8f28c7b4bcad5c209b21b7e3b3&v=85678e8f28c7b4bcad5c209b21b7e3b3);
      position: absolute;
      top: 50%;
      right: 11px;
      margin-top: -8px;
      width: 17px;
      height: 17px;
      background-position: 0 -40px;
    }
    i:hover {
      background-position: 0 -60px;
    }
  }

  .header-login {
    padding: 0 50px;
    height: 90px;
    vertical-align: auto;
    line-height: 90px;
    margin-left: -30px;
    position: relative;
    .show {
      display: none;
    }
    a {
      display: inline-block;
      height: 90px;
      color: #000;
      text-decoration: none;
      font-size: 20px;
    }
    a:hover {
      color: #31c27c;
    }
    .showuser {
      .loginout {
        position: absolute;
        background: #fff;
        height: 30px;
        width: 100%;
        color: #000;
        font-size: 16px;
        line-height: 30px;
        text-align: center;
        display: none;
        right: 0;
        top: 57px;
      }
    }
    .showuser:hover .loginout {
      display: block;
    }
  }
  }

  .portal-music-header {
    background: url(../assets/bg_profile.jpg) 50% no-repeat;
    background-size: cover;
    text-align: center;
    color: #fff;
    height: 315px;
    width: 100%;
    padding-top: 65px;
  }
  .portal-music-header-inner {
    height: 315px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
  }
  .portal-music-header-link {
    position: relative;
    width: 102px;
    height: 102px;
    margin: 0 auto;
  }
  .portal-music-header-image {
    display: block;
    width: 100%;
    height: 100%;
    border: 4px solid #fff;
    border-radius: 99px;
    background: #fff;
  }
  h1 {
    font-size: 0;
  }
  .portal-music-header-name {
    font-size: 30px;
    font-weight: 400;
    line-height: 64px;
    margin-right: 14px;
  }
  a {
    text-decoration: none;
  }
  .lv {
    vertical-align: -3px;
  }
  .portal-music-main {
    min-height: 500px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
  }
  .portal-music-main-nav {
    position: absolute;
    top: -56px;
    left: 0;
    margin-bottom: 0;
    width: 80%;
    overflow: hidden;
    border-bottom: 0 none;
    height: 56px;
    line-height: 56px;
  }
  .portal-music-main-navlike:hover{
      color: #31c27c;
  }
  .active{
      color: #31c27c !important;
  }
  .portal-music-main-navlike {
    margin-right: 40px;
    position: relative;
    float: left;
    font-size: 16px;
    overflow: hidden;
    height: 56px;
    line-height: 56px;
    color: #fff;
  }
  .portal-music-main-list-tab {
    margin-bottom: -20px;
    overflow: hidden;
    border-bottom: 0 none;
    position: relative;
    height: 56px;
    line-height: 56px;
  }
  .portal-music-main-list-tab-item {
    position: relative;
    float: left;
    font-size: 16px;
    overflow: hidden;
    margin-right: 55px;
    height: 56px;
    line-height: 56px;
    color: black;
  }
  .portal-music-main-list-tab-item:hover{
      color: #31c27c;
  }
  .portal-music-main-list-cont-sub-list {
    padding-top: 50px;
    overflow: hidden;
  }
  .portal-music-main-list-cont-sub-list-playlist {
    margin-right: -20px;
  }
  .portal-music-main-list-cont-sub-list-playlist-item {
    display: inline-block;
    width: 20%;
    padding-bottom: 44px;
    overflow: hidden;
    font-size: 14px;
    vertical-align: top;
  }
  .portal-music-main-list-cont-sub-list-playlist-item-box {
    position: relative;
    margin-right: 20px;
  }
  .portal-music-main-list-cont-sub-list-playlist-item-box-cover {
    position: relative;
    display: block;
    overflow: hidden;
    padding-top: 100%;
    margin-bottom: 15px;
    
  }
  .pic{
      height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
  .icon{
      background: url(../assets/cover_play.png);
      position: absolute;
    left: 50%;
    top: 50%;
    margin: -35px;
    width: 70px;
    height: 70px;
    opacity: 0;
  }
  .icon:hover{
      opacity: 1;
  }
}
</style>